using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SimplIDE
{
    public partial class NewFileForm : Form
    {
        FileTree tree;
        string prvname;
        bool made = false;
        public NewFileForm(FileTree tr)
        {
            InitializeComponent();
            tree = tr;
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            tree.AddFile(txtBoxFile.Text);
            prvname = txtBoxFile.Text;
            made = true;
            this.Close();
        }

        private void btnCncl_Click(object sender, EventArgs e)
        {
            made = false;
            this.Close();
        }
        public string FileName
        {
            get
            {
                return prvname;
            }
        }
        public bool Made
        {
            get
            {
                return made;
            }
            set
            {
                made = value;
            }
        }

      private void txtBoxFile_KeyDown(object sender, KeyEventArgs e)
      {
        if (e.KeyCode == Keys.Enter)
        {
          e.Handled = true;
          this.btnOk.PerformClick();
        }
      }
    }
}